package com.baosight.risk.web.api;

import com.baosight.risk.webservice.TargetOutWebService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.core.MediaType;

/**
 * @author HXJ
 * @create 2020/11/16 16:13
 */
@Slf4j
@RestController
@RequestMapping("/fkapi/inner")
@Api(value = "内部获取数据的开放接口", description = "内部获取数据的开放接口", produces = MediaType.APPLICATION_JSON)
public class SelectTestController {

    @Autowired
    private TargetOutWebService targetOutWebService;

    @GetMapping("getWanDe")
    @ApiOperation("获取万得数据")
    private String getWanDe(@RequestParam("yesterday") String yesterday)throws Exception{
        String jsonString = "[{\"beginTime\":\"" + yesterday + "\",\"endTime\":\"" + yesterday + "\",\"targetNo\":\"\"}]";
        String dataResult = targetOutWebService.sendRequestResult(jsonString);
        return  dataResult;
    }

}
